
<table>
  <tbody>
    <?php 
    	$i = 0; 
    	foreach ($cartes as $carte):  
    		if($i%3==0 && $i != 0) 
    			echo "</tr><tr>"; 
    		if($i==0) 
    			echo "<tr>"; 
    		$i++;
    ?>
    <td>
      <table>
      <tr>
      	<td><img src="<?php echo $carte->getPoza() ?>" width="50" height="80"></td>
      	<td>
      		<table>
      		<tr>
      			<td width="200"><a href = <?php echo url_for('carte/show?id_carte='.$carte->getIdCarte().'&titlu='.$carte->getTitlu()); ?>"> 
      			<?php $link = $carte->Details();  echo $link; ?></a></td>
      		</tr>
			<tr>
				<td><b><?php echo $carte->getAutori(); ?></b></td>
			</tr>
      		<tr>
      			<td><b><?php echo $carte->getAutori(); ?></b></td>
      		</tr>
      		<tr>
      			<td><b><?php echo $carte->getPret(); echo " lei" ?></b></td>
      		</tr>
      		<tr>
      			<td><?php if($carte->getStoc()>0) echo "In stoc"; else echo "Stoc epuizat" ?></td>
      		</tr>
      		</table>
      	</td>
      </tr>
      </table>
      </td>
    <?php endforeach; ?>
  </tbody>
</table>
